/*
 * @Author: chenr 526963089@qq.com
 * @Date: 2023-02-10 14:55:29
 * @LastEditors: chenr 526963089@qq.com
 * @LastEditTime: 2023-03-01 14:44:46
 * @Description: 路由设置
 */
import { shallowRef } from 'vue';
import { BasicLayout, RouterView, PageView } from '../layouts';
import type { RouterInterface } from '@/router/types';
import { SRC_OFFICIAL } from '@/constants/config';

/**
 * @description: 路由映射表
 * @return {*}
 */
export const constantRouterComponents: any = {
  PageView: PageView,
  RouterView: RouterView,
  Home: () => import('../views/Home/index.vue'),
  Test01: () => import('../views/test/01/index.vue'),
  Test02: () => import('../views/test/02/index.vue'),
  Test03: () => import('../views/test/03/index.vue'),
  Test04: () => import('../views/test/04/index.vue'),
};

/**
 * @description: 根级菜单
 * @return {*}
 */
export const rootRouter: RouterInterface = {
  path: `/${SRC_OFFICIAL}`,
  redirect: `/${SRC_OFFICIAL}/home`,
  name: `${SRC_OFFICIAL}Workbench`,
  meta: { title: '工作台' },
  component: shallowRef(BasicLayout),
  children: [],
};
